package com.example.administrator.im.data;

import android.support.annotation.NonNull;

import com.hyphenate.chat.EMMessage;

/**
 * create:2018/9/25 21:41
 * author: 姚鸿杰
 **/
public class IMData implements Comparable<IMData> {

    private EMMessage msg;

    private boolean isAcked;

    public IMData(EMMessage msg, boolean isAcked) {
        this.msg = msg;
        this.isAcked = isAcked;
    }

    public EMMessage getMsg() {
        return msg;
    }

    public boolean isAcked() {
        return isAcked;
    }

    public void setAcked(boolean acked) {
        isAcked = acked;
    }

    @Override
    public int compareTo(@NonNull IMData imData) {
        if(msg.getMsgTime() > imData.msg.getMsgTime()){
            return -1;
        }else if(msg.getMsgTime() < imData.msg.getMsgTime()) {
            return 1;
        }
        return 0;
    }

}
